<%@ page import="org.subject.entity.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--引入 jstl--%>
<%@include file="common/tag.jsp" %>
<!DOCTYPE html>
<%-- 获取资源根路径--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <title>首页</title>
    <%@include file="common/head.jsp" %>
    <script src="/./resource/js/list.js"></script>
    <style>
        a {
            text-decoration: none
        }

        html, body {
            margin: 0;
            padding: 0;
            height: 100%;
        }

        #container {
            min-height: 100%;
            height: auto !important;
            height: 100%; /*IE6不识别min-height*/
            position: relative;
        }

        #page {
            width: 100%;
            margin-bottom: 50px; /*等于footer的高度*/
        }

        .bordercolor {
            border-style: solid;
            border-color: #CBEAFA;
        }

        .bordercolor td {
            height: 20px;
        }
    </style>
</head>
<body background="/./resource/images/bg.jpg" style="background-size: cover;background-repeat: no-repeat;">
<%--页面显示部分--%>
<div id="container" class="container">
    <jsp:include page="common/Top.jsp"/>
    <div id="page" class="panel panel-default">
        <div class="panel-heading">
            <h5>${message.messageTitle}报名列表</h5>
        </div>
        <div class="panel-body">
            <c:choose>
                <c:when test="${sessionScope.user != null}">
                    <div class="col-md-12">
                        <form action="<%=basePath%>regist/exportExcel" method="post">
                            <table width="100%" border="0" cellpadding="0" cellspacing="0"
                                   bgcolor="b5d6e6">
                                <tr>
                                    <td><input type="text" name="messageId" value="${message.messageId}" hidden></td>
                                </tr>
                                <tr>
                                    <td width="10%" align="right">
                                        <input type="submit" value="导出报名用户数据"/>
                                    </td>
                                </tr>
                            </table>
                        </form>
                        <table border="1" width="100%" class="bordercolor" style="margin-top: 20px">
                            <thead>
                            <tr bgcolor="#CBEAFA" align="center">
                                <td align="center">序号</td>
                                <td align="center">学号</td>
                                <td align="center">姓名</td>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${userList}" var="user" varStatus="status">
                                <tr <c:if test="${status.index % 2 != 0}">style='background-color:#ECF6EE;'</c:if>>
                                    <td style="height:40px" align="center">${status.index + 1}</td>
                                    <td style="height:40px" align="center">${user.userNumber}</td>
                                    <td style="height:40px" align="center">${user.userName}</td>
                                        <%--<td><fmt:formatDate value="${message.createTime}" pattern="yyyy-MM-dd"/></td>
                                        <td>
                                            <a href="/message/detail?messageId=${message.messageId}">查看</a>&nbsp;&nbsp;&nbsp;
                                            <a href="/message/delete?messageId=${message.messageId}">删除</a>
                                        </td>--%>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                            <%--<div class='page fix pageNum'>
                                共 <b>${page.totalNumber}</b> 条
                                <c:if test="${page.currentPage != 1}">
                                    <a href="<%= basePath %>message/page?page=1" class='first'>首页</a>
                                    <a href="<%= basePath %>message/page?page=${page.currentPage-1}" class='pre'>上一页</a>
                                </c:if>
                                当前第<span>${page.currentPage}/${page.totalPage}</span>页
                                <c:if test="${page.currentPage != page.totalPage}">
                                    <a href="<%= basePath %>message/page?page=${page.currentPage+1}" class='next'>下一页</a>
                                    <a href="<%= basePath %>message/page?page=${page.totalPage}" class='last'>末页</a>
                                </c:if>
                                跳至&nbsp;<input id="currentPageText" type='text' value='${page.currentPage}'
                                               class='allInput w28'/>&nbsp;页&nbsp;
                                <a href="javascript:changeCurrentPage($('#currentPageText').val())" class='go'>GO</a>
                            </div>--%>
                    </div>
                </c:when>
            </c:choose>
        </div>
    </div>
    <jsp:include page="common/footer.jsp"/>
</div>
</body>
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</html>